package com.example.module_hzd_host

import android.os.Bundle
import android.view.View
import androidx.fragment.app.Fragment
import com.alibaba.android.arouter.launcher.ARouter
import com.example.module_audio_edit.base.BaseMvvmFragment
import com.example.module_hp_zao_yin.activity.HpGongJuSoundActivity
import com.example.module_hzd_host.databinding.FragmentFenbeiThirdpageBinding
import com.example.module_lzq_haibathree.activity.RulerActivity
import com.example.module_lzq_haibathree.activity.SpiritLevelActivity
import com.fwlst.lib_base.model.BaseViewModel
import com.fwlst.lib_base.utils.AdUtils

class FenBeiThirdPageFragment : BaseMvvmFragment<FragmentFenbeiThirdpageBinding, BaseViewModel>() {
    override fun initLayout(): Int {
        return R.layout.fragment_fenbei_thirdpage
    }

    override fun initBR(): Int {
        return 0
    }

    override fun initView(view: View?, savedInstanceState: Bundle?) {
       val fragment  = ARouter.getInstance().build("/module_sleep/route/AlarmClockFragment")
            .navigation() as Fragment
        childFragmentManager.beginTransaction().replace(R.id.flContainer,fragment).commit()

        binding.ivTab1.setOnClickListener {// 测距仪
            AdUtils.checkFunction(requireContext()) {
                navigateTo(RulerActivity::class.java)
            }
        }
        binding.ivTab2.setOnClickListener {// 水平仪
            AdUtils.checkFunction(requireContext()) {
                navigateTo(SpiritLevelActivity::class.java)
            }
        }
        binding.ivTab3.setOnClickListener {// 尺子测量
            AdUtils.checkFunction(requireContext()) {
                ARouter.getInstance()
                    .build("/moduleSmallTools/route/SmallToolsRulerActivity")
                    .navigation()
            }
        }
        binding.ivTab4.setOnClickListener {// 分贝参数
            AdUtils.checkFunction(requireContext()) {
                navigateTo(HpGongJuSoundActivity::class.java)
            }
        }
        binding.ivTab5.setOnClickListener {// 专注模式
            AdUtils.checkFunction(requireContext()) {
                ARouter.getInstance().build("/hpWhiteNoise/route/HpSleepFocusActivity").navigation()
            }
        }
        binding.ivTab6.setOnClickListener {// 沉浸时刻
            AdUtils.checkFunction(requireContext()) {
                ARouter.getInstance().build("/hpWhiteNoise/route/HpSleepPlayActivity").navigation()
            }
        }
        binding.ivTab7.setOnClickListener {// 有氧呼吸
            AdUtils.checkFunction(requireContext()) {
                ARouter.getInstance().build("/hpWhiteNoise/route/HpSleepBreatheActivity")
                    .navigation()
            }
        }
    }
}